
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>脚本 · Shadow Editor文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../update/UpdateLog.html" />
    
    
    <link rel="prev" href="../ui/StatusBar.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                        <b>1.1.</b>
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../ui/UI.html">
            
                <a href="../ui/UI.html">
            
                    
                        <b>1.2.</b>
                    
                    用户界面
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../ui/MenuBar.html">
            
                <a href="../ui/MenuBar.html">
            
                    
                        <b>1.2.1.</b>
                    
                    菜单栏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../ui/AssetsPanel.html">
            
                <a href="../ui/AssetsPanel.html">
            
                    
                        <b>1.2.2.</b>
                    
                    资源管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../ui/Toolbar.html">
            
                <a href="../ui/Toolbar.html">
            
                    
                        <b>1.2.3.</b>
                    
                    工具栏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../ui/Scene.html">
            
                <a href="../ui/Scene.html">
            
                    
                        <b>1.2.4.</b>
                    
                    场景编辑区
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../ui/AnimationEditor.html">
            
                <a href="../ui/AnimationEditor.html">
            
                    
                        <b>1.2.5.</b>
                    
                    动画编辑区
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../ui/SideBar.html">
            
                <a href="../ui/SideBar.html">
            
                    
                        <b>1.2.6.</b>
                    
                    侧边栏
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.6.1" data-path="../ui/sidebar/Hierarchy.html">
            
                <a href="../ui/sidebar/Hierarchy.html">
            
                    
                        <b>1.2.6.1.</b>
                    
                    场景面板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.2" data-path="../ui/sidebar/History.html">
            
                <a href="../ui/sidebar/History.html">
            
                    
                        <b>1.2.6.2.</b>
                    
                    历史面板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.3" data-path="../ui/sidebar/Property.html">
            
                <a href="../ui/sidebar/Property.html">
            
                    
                        <b>1.2.6.3.</b>
                    
                    属性面板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.4" data-path="../ui/sidebar/Script.html">
            
                <a href="../ui/sidebar/Script.html">
            
                    
                        <b>1.2.6.4.</b>
                    
                    脚本面板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.5" data-path="../ui/sidebar/Animation.html">
            
                <a href="../ui/sidebar/Animation.html">
            
                    
                        <b>1.2.6.5.</b>
                    
                    动画面板
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../ui/StatusBar.html">
            
                <a href="../ui/StatusBar.html">
            
                    
                        <b>1.2.7.</b>
                    
                    状态栏
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="Script.html">
            
                <a href="Script.html">
            
                    
                        <b>1.3.</b>
                    
                    脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../update/UpdateLog.html">
            
                <a href="../update/UpdateLog.html">
            
                    
                        <b>1.4.</b>
                    
                    更新日志
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >脚本</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x811A;&#x672C;">&#x811A;&#x672C;</h1>
<p>&#x6211;&#x4EEC;&#x901A;&#x8FC7;<code>&#x6B63;&#x65B9;&#x4F53;&#x65CB;&#x8F6C;</code>&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x8BF4;&#x660E;&#x811A;&#x672C;&#x7684;&#x7528;&#x6CD5;&#x3002;</p>
<ul>
<li>&#x5728;&#x573A;&#x666F;&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x540D;&#x79F0;&#x4E3A;<code>&#x6B63;&#x65B9;&#x4F53;</code>&#x7684;&#x6B63;&#x65B9;&#x4F53;&#x3002;</li>
</ul>
<p><img src="../images/script-add-box.png" alt="image"></p>
<ul>
<li>&#x5728;&#x4FA7;&#x8FB9;&#x680F;&#x811A;&#x672C;&#x9762;&#x677F;&#x70B9;&#x51FB;<code>&#x65B0;&#x5EFA;&#x811A;&#x672C;</code>&#x6309;&#x94AE;&#xFF0C;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x53EB;<code>&#x6B63;&#x65B9;&#x4F53;&#x65CB;&#x8F6C;</code>&#x7684;&#x811A;&#x672C;&#x3002;</li>
</ul>
<p><img src="../images/script-add-script.png" alt="image"></p>
<ul>
<li>&#x4FEE;&#x6539;&#x811A;&#x672C;&#x4E3A;&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#xFF0C;&#x5173;&#x95ED;&#x811A;&#x672C;&#x7F16;&#x8F91;&#x5668;&#x4F1A;&#x81EA;&#x52A8;&#x4FDD;&#x5B58;&#x3002;</li>
</ul>
<p><img src="../images/script-edit-script.png" alt="image"></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> box = scene.getObjectByName(<span class="hljs-string">&apos;&#x6B63;&#x65B9;&#x4F53;&apos;</span>);

<span class="hljs-comment">// &#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x6BCF;&#x5E27;&#x90FD;&#x8981;&#x6267;&#x884C;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">update</span>(<span class="hljs-params">clock, deltaTime</span>) </span>{
    box.rotation.x += <span class="hljs-number">0.1</span>;
}
</code></pre>
<ul>
<li>&#x70B9;&#x51FB;&#x64AD;&#x653E;&#x83DC;&#x5355;&#x4E0B;&#x7684;&#x64AD;&#x653E;&#x3002;&#x6B63;&#x65B9;&#x4F53;&#x65CB;&#x8F6C;&#x8D77;&#x6765;&#x4E86;&#x3002;</li>
</ul>
<p><img src="../images/script-play.png" alt="image"></p>
<p><img src="../images/script-rotate.png" alt="image"></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../ui/StatusBar.html" class="navigation navigation-prev " aria-label="Previous page: 状态栏">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../update/UpdateLog.html" class="navigation navigation-next " aria-label="Next page: 更新日志">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"脚本","level":"1.3","depth":1,"next":{"title":"更新日志","level":"1.4","depth":1,"path":"update/UpdateLog.md","ref":"update/UpdateLog.md","articles":[]},"previous":{"title":"状态栏","level":"1.2.7","depth":2,"path":"ui/StatusBar.md","ref":"ui/StatusBar.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters-small"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"expandable-chapters-small":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}},"theme":"default","pdf":{"pageBreaksBefore":"/","headerTemplate":null,"paperSize":"a4","margin":{"right":62,"left":62,"top":36,"bottom":36},"fontSize":12,"fontFamily":"Arial","footerTemplate":null,"chapterMark":"pagebreak","pageNumbers":true},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Shadow Editor文档","gitbook":"*","description":"Shadow Editor文档"},"file":{"path":"script/Script.md","mtime":"2019-09-15T01:55:55.441Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-15T02:54:19.743Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

